<?php $this->load->view(TEMPLATE_NAME.'/admin/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.validate.pack.js"></script>
<script>
$(document).ready(function(){    
    $('#form_your_info').validate({
        rules : {
            birthday_day : "required",
            birthday_month : "required",
            birthday_year : "required",
            sex : "required",
            marital_status : "required",
            have_children : "required",
            home_language : "required",
            second_language : "required",
            ethnicity : "required",
            employment : "required",
            occupation : "required"
        },
	messages:{
            birthday_day : "Please select your birth day",
            birthday_month : "Please select your birth month",
            birthday_year : "Please select your birth year",
            sex : "Please select your sex",
            marital_status : "Please select marital status",
            have_children : "Please select your children status",
            home_language : "Please select your home language",
            second_language : "Please select your second language",
            ethnicity : "Please select your ethnicity",
            employment : "Please select your employment status",
            occupation : "rPlease select your occupation"
	}
    });              
});
</script>
<div class="page noright adminpage adminuser">
    
    <?php $this->load->view(TEMPLATE_NAME.'/admin/profile/profile_tabs');?>
    <h2 class="no">Your information - not compulsory</h2>   
    <p class="black f13"><strong>Private and Confidential</strong>. 
    All information here is <strong>not shared</strong> and is treated highly confidentially.<br /> 
    Information is simply aggregated to create a rough impression of the network and to allow decision makers to gain a better understanding of the area. This data serves as a more up-to-date census of the area in question.<br />
    Information from this section will only ever be presented as a group average. Under no circumstances will individual data ever be revealed.</p>
<?php if(!empty($notification)): ?>
<p><?php echo $notification ?></p>
<?php endif; ?>
    <hr />
    
    <?php echo form_open('admin/profile/your_info',array('method' => 'post', 'class' => 'formstep formp', 'id' => 'form_your_info'));?>    
    <p><label class="">Date of Birth: <span class="purple">*</span></label> 
    <select name="birthday_day">
    <option value="">Day</option>
    <?php
    for ($i=1; $i<=31; $i++){
        echo "<option value='".$i."'";
        if ($i == substr($your_info['birthdate'], 8,2)){
            echo "selected='selected' ";
        }
        echo ">".$i."</option>";    
    }
    ?>
    </select>
    <select name="birthday_month">
    <option value="">Month</option>
    <?php
    $month = array("1"=>"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    for ($j=1; $j<=12; $j++){
        echo "<option value='".$j."'";
        if ($j == substr($your_info['birthdate'], 5,2)){
            echo "selected='selected' ";
        }
        echo ">".$month[$j]."</option>";           
    }
    ?>
    </select>
    <select name="birthday_year">
    <option value="">Year</option>
    <?php
    for ($k=date('Y')-100; $k<=date('Y')-18; $k++){
        echo "<option value='".$k."'";
        if ($k == substr($your_info['birthdate'], 0,4)){
            echo "selected='selected' ";
        }
        echo ">".$k."</option>";
    }
    ?>
    </select>
    <?php echo form_error('birthday_day') ?>
    <?php echo form_error('birthday_month') ?>
    <?php echo form_error('birthday_year') ?>   
    </p>    
    <p><label class="">Sex: <span class="purple">*</span></label> 
    <input type="radio" name="sex" <?php if ($your_info['sex'] == "M"){?>checked="checked"<?php }?> value="M"/> Male 
    <input type="radio" name="sex" <?php if ($your_info['sex'] == "F"){?>checked="checked"<?php }?> value="F"/> Female     
    </p>
    <?php echo form_error('sex') ?>
    <p><label class="">Marital Status: <span class="purple">*</span></label> 
    <input type="radio" name="marital_status" <?php if ($your_info['marital_status'] == "S"){?>checked="checked"<?php }?> value="S"/> Single 
    <input type="radio" name="marital_status" <?php if ($your_info['marital_status'] == "L"){?>checked="checked"<?php }?> value="L"/> Living Together     
    <input type="radio" name="marital_status" <?php if ($your_info['marital_status'] == "M"){?>checked="checked"<?php }?> value="M"/> Married
    </p>
    <?php echo form_error('marital_status') ?>
    <p><label class="">Have Children: <span class="purple">*</span></label> 
    <input type="radio" name="have_children" <?php if ($your_info['have_children'] == "Y"){?>checked="checked"<?php }?> value="Y"/> Yes 
    <input type="radio" name="have_children" <?php if ($your_info['have_children'] == "N"){?>checked="checked"<?php }?> value="N"/> No    
    </p>
    <?php echo form_error('have_children') ?>
    <p class="nop ">Languages <span class="purple norm">(all information is confidential)</span></p>
    <p><label class="">Home Language: <span class="purple">*</span></label> 
    <select name="home_language" class="w200">
    <option value="">Select Language</option>    
    <?php foreach ($language as $lang){
        echo "<option value='".$lang['language']."' ";
        if($lang['language'] == $your_info['home_language']){ echo "selected='selected'";}
        echo ">".$lang['language']."</option>";
    }
    ?>
    </select>        
    </p>
    <?php echo form_error('home_language') ?> 
    <p><label class="">Second Language: <span class="purple">*</span></label> 
    <select name="second_language" class="w200">
    <option value="">Select Language</option>
    <?php foreach ($language as $lang_other){
        echo "<option value='".$lang_other['language']."' ";
        if($lang_other['language'] == $your_info['second_language']){ echo "selected='selected'";}
        echo ">".$lang_other['language']."</option>";
    }
    ?> 
    </select>        
    </p>
    <?php echo form_error('second_language') ?>
    <p class="nop ">Ethnic Group <span class="purple norm">(all information is confidential)</span></p>
    <p><label class="">Ethnicity: <span class="purple">*</span></label> 
    <select name="ethnicity" class="w200">
    <option value="">Select Ethnic</option>
    <?php foreach ($ethnic as $ethnicity){
        echo "<option value='".$ethnicity['ethnic']."' ";
        if($ethnicity['ethnic'] == $your_info['ethnicity']){ echo "selected='selected'";}       
        echo ">".$ethnicity['ethnic']."</option>";
    }
    ?>
    <option value="english">English</option>
    </select>        
    </p>
    <?php echo form_error('ethnicity') ?>
    <p class="nop ">Employment <span class="purple norm">(all information is confidential)</span></p>
    <p><label class="">Employment: <span class="purple">*</span></label> 
    <input type="radio" name="employment" <?php if ($your_info['employment'] == "E"){?>checked="checked"<?php }?> value="E"/> Employed 
    <input type="radio" name="employment" <?php if ($your_info['employment'] == "U"){?>checked="checked"<?php }?> value="U"/> Unemployed     
    <input type="radio" name="employment" <?php if ($your_info['employment'] == "S"){?>checked="checked"<?php }?> value="S"/> Self-Employed
    <input type="radio" name="employment" <?php if ($your_info['employment'] == "R"){?>checked="checked"<?php }?> value="R"/> Retired
    </p>
    <?php echo form_error('employment') ?>
    <p><label class="">Occupation: <span class="purple">*</span></label> 
    <select name="occupation">
    <option value="">Select industry or sector</option>
    <?php foreach ($occupation as $occup){
        echo "<option value='".$occup['occupation']."' ";
        if($occup['occupation'] == $your_info['occupation']){ echo "selected='selected'";}
        echo ">".$occup['occupation']."</option>";
    }
    ?>
    </select>        
    </p>
    <?php echo form_error('occupation') ?>
    
    <hr />
    <?php 
        $form_button = array(
            'type'=>'submit',
            'name'=>'submit',
            'value'=>'submit',
            'content'=>'Submit',
        );
        echo form_button($form_button) ?>
    <div class="clear"></div>
<?php echo form_close(); ?><!-- formstep --> 
</div><!-- page -->
<?php $this->load->view(TEMPLATE_NAME.'/admin/footer');?>
